﻿@model FarmeWork.Helper.PagedData<dai_hoc_tuong_lai.Areas.Admin.Models.Tongquang_Model>
<script type="text/javascript">
    $(document).ready(function () {
        makeEventDialog("a.makeUpdate")
        $(".page-number").live("click", function () {
            var page = parseInt($(this).html());
            $.get("/Admin/Tongquan/List?&page=" + page, function (data) {
                $("#DivListData").html("");
                $("#DivListData").html(data);
            });
        });

        $("a.detele").click(function () {
            var $this = $(this);
            var CateName = $this.closest('tr').find('.spanNameCate').html();
            if (confirm("Bạn muốn xóa giới thiệu - tổng quan: " + CateName + "")) {
                var Cateid = $this.closest('tr').find('.Cate-id').html();
                $.get("/Admin/Tongquan/Delete?id=" + Cateid, function (data) {
                    makeRequest(data);
                });
            }
        });

    });

    function makeRequest(obj) {

        if (obj.Status == "success") {
            if (obj.Message != null) {
                alert(obj.Message);
            }
            else if (obj.RedirectUrl != null) {
                window.location.href = obj.RedirectUrl;
            }
        } else {
            alert(obj.Message);
        }

        return false;
    }

</script>
<article class="module width_3_quarter">
		<header><h3 class="tabs_involved">Quảng lý giới thiệu - tổng quan</h3>
		</header>
		<div class="tab_container">
			<div id="tab1" class="tab_content">
			<table class="tablesorter" cellspacing="0"> 
			<thead> 
				<tr> 
   					<th>Id</th> 
    				<th>Tiêu đề</th> 
    				<th>Hành động</th> 
				</tr> 
			</thead> 
            <tfoot>
            <tr>
                <td colspan="4" class="rounded-foot-left">
                    <em>Danh sách giới thiệu - tổng quan </em>
                </td>
            </tr>
        </tfoot>
			<tbody> 
                @if (Model.Data != null)
                {
                    foreach (var item in Model.Data)
                    {
				        <tr> 
   					        <td><span class="Cate-id">@item.Id</span></td> 
    				        <td><span class="spanNameCate">@item.Name</span></td> 
    				        <td>
                                <a href="/Admin/Tongquan/Update?id=@item.Id" class="makeUpdate" data-dialog-title="Update giới thiệu - tổng quan" data-dialog-id="editTopic">
                                    <input type="image" src="/Scripts/HTML5_Admin_Template/images/icn_edit.png" title="Edit">
                                </a>
                                 <a href="javascript:void(0)" class="detele">
                                    <input type="image" src="/Scripts/HTML5_Admin_Template/images/icn_trash.png" title="detele">
                                </a>
                            </td> 
				        </tr> 
                    }
                }
			</tbody> 
			</table>
			</div><!-- end of #tab1 -->
		</div><!-- end of .tab_container -->
   </article>
<div class="pagination">
    @for (int m = 1; m <= Model.NumberOfPages; m++)
    {
        if (m == Model.CurrentPage)
        {
        <span class="current" href="javascript:void(0);">@m</span>
        }
        else
        {
        <a class="next page-number" href="javascript:void(0);">@m</a>
        }


    }
</div>
